Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retool tests #88

Merged
merged 4 commits into from
Jul 18, 2024
Merged

Retool tests #88

merged 4 commits into from
Jul 18, 2024

Conversation

viega
Copy link
Contributor

@viega viega commented Jul 18, 2024

Retool the test system to fork by default, so that if a test crashes the runner will still complete.

@viega viega requested a review from orangematt July 18, 2024 03:23
@ee7 ee7 self-requested a review July 18, 2024 12:04
Copy link
Contributor

@ee7 ee7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests seemed to be crashing locally. Checking now with 258c1e9.

Copy link
Contributor

@ee7 ee7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, it looks like setting CON4M_ROOT is once again required, to avoid a crash. Am I doing something dumb? I'd removed it from my shell config after e0a0219:

  • Fix the issue w/ CON4M_ROOT being necessary to run tests.

Should we remove CON4M_ROOT from the workflow, such that requiring it would produce a CI failure?

CON4M_ROOT: .

With 258c1e9 and a clean working directory:

$ rm -rf build_dev
$ ./dev profile dev
$ CC=clang ./dev compile
$ cd build_dev
$ printenv CON4M_ROOT
$ CON4M_ROOT=../ ./c4test
[...]
Passed 60 out of 60 run tests.
 Con4m testing PASSED.
$ ./c4test
zsh: segmentation fault (core dumped)  ./c4test
$ ./c4test /path/to/libcon4m/tests/basic01.c4m
zsh: segmentation fault (core dumped)  ./c4test /path/to/libcon4m/tests/basic01.c4m
$ valgrind --track-origins=yes --leak-check=no -s -- ./c4test /path/to/libcon4m/tests/basic01.c4m
[...]
Running test 1: /path/to/libcon4m/tests/basic01.c4m
Processing module /path/to/libcon4m/tests/basic01.c4m
info: Done processing: /path/to/libcon4m/tests/basic01.c4m
****STARTING PROGRAM EXECUTION*****
****PROGRAM EXECUTION FINISHED*****
[...]
/path/to/libcon4m/tests/basic01.c4m exited with return code: 0.
Finished test 1: (/path/to/libcon4m/tests/basic01.c4m). PASSED.
Passed 1 out of 1 run tests.
 Con4m testing PASSED.
[...]
ERROR SUMMARY: 15 errors from 9 contexts (suppressed: 0 from 0)

1 errors in context 1 of 9:
Conditional jump or move depends on uninitialised value(s)
   at 0x138D15: _c4m_str_find (../src/adts/string.c:1146)
   by 0x1395FF: c4m_str_xsplit (../src/adts/string.c:1277)
   by 0x193ACF: c4m_resolve_path (../src/util/path.c:168)
   by 0x11B226: c4m_con4m_root (../src/core/init.c:134)
   by 0x11B405: c4m_system_module_path (../src/core/init.c:155)
   by 0x11BDF5: c4m_init_path (../src/core/init.c:180)
   by 0x11BB08: c4m_init (../src/core/init.c:295)
   by 0x4F08DC3: call_init (libc-start.c:145)
   by 0x4F08DC3: __libc_start_main@@GLIBC_2.34 (libc-start.c:347)
   by 0x117724: (below main) (in /path/to/libcon4m/build_dev/c4test)
 Uninitialised value was created by a stack allocation
   at 0x194024: c4m_app_path (../src/util/path.c:458)


1 errors in context 2 of 9:
Conditional jump or move depends on uninitialised value(s)
   at 0x138D15: _c4m_str_find (../src/adts/string.c:1146)
   by 0x1395FF: c4m_str_xsplit (../src/adts/string.c:1277)
   by 0x193ACF: c4m_resolve_path (../src/util/path.c:168)
   by 0x11B19A: c4m_con4m_root (../src/core/init.c:130)
   by 0x11B405: c4m_system_module_path (../src/core/init.c:155)
   by 0x11BDF5: c4m_init_path (../src/core/init.c:180)
   by 0x11BB08: c4m_init (../src/core/init.c:295)
   by 0x4F08DC3: call_init (libc-start.c:145)
   by 0x4F08DC3: __libc_start_main@@GLIBC_2.34 (libc-start.c:347)
   by 0x117724: (below main) (in /path/to/libcon4m/build_dev/c4test)
 Uninitialised value was created by a stack allocation
   at 0x194024: c4m_app_path (../src/util/path.c:458)


1 errors in context 3 of 9:
Conditional jump or move depends on uninitialised value(s)
   at 0x48A4334: UnknownInlinedFun (utf8proc.c:135)
   by 0x48A4334: utf8proc_iterate (utf8proc.c:125)
   by 0x13568B: c4m_internal_utf8_set_codepoint_count (../src/adts/string.c:17)
   by 0x13A3A4: utf8_init (../src/adts/string.c:662)
   by 0x133F1F: _c4m_new (../src/core/object.c:476)
   by 0x1940ED: c4m_app_path (../src/util/path.c:464)
   by 0x11B192: c4m_con4m_root (../src/core/init.c:130)
   by 0x11B405: c4m_system_module_path (../src/core/init.c:155)
   by 0x11BDF5: c4m_init_path (../src/core/init.c:180)
   by 0x11BB08: c4m_init (../src/core/init.c:295)
   by 0x4F08DC3: call_init (libc-start.c:145)
   by 0x4F08DC3: __libc_start_main@@GLIBC_2.34 (libc-start.c:347)
   by 0x117724: (below main) (in /path/to/libcon4m/build_dev/c4test)
 Uninitialised value was created by a stack allocation
   at 0x194024: c4m_app_path (../src/util/path.c:458)


2 errors in context 4 of 9:
Conditional jump or move depends on uninitialised value(s)
   at 0x48A44DD: utf8proc_encode_char (utf8proc.c:180)
   by 0x1365ED: c4m_to_utf8 (../src/adts/string.c:569)
   by 0x1936EA: internal_normalize_and_join (../src/util/path.c:64)
   by 0x193AD7: c4m_resolve_path (../src/util/path.c:167)
   by 0x11B19A: c4m_con4m_root (../src/core/init.c:130)
   by 0x11B405: c4m_system_module_path (../src/core/init.c:155)
   by 0x11BDF5: c4m_init_path (../src/core/init.c:180)
   by 0x11BB08: c4m_init (../src/core/init.c:295)
   by 0x4F08DC3: call_init (libc-start.c:145)
   by 0x4F08DC3: __libc_start_main@@GLIBC_2.34 (libc-start.c:347)
   by 0x117724: (below main) (in /path/to/libcon4m/build_dev/c4test)
 Uninitialised value was created by a stack allocation
   at 0x194024: c4m_app_path (../src/util/path.c:458)


2 errors in context 5 of 9:
Conditional jump or move depends on uninitialised value(s)
   at 0x48A4334: UnknownInlinedFun (utf8proc.c:135)
   by 0x48A4334: utf8proc_iterate (utf8proc.c:125)
   by 0x135ECD: c4m_to_utf32 (../src/adts/string.c:605)
   by 0x13946B: c4m_str_xsplit (../src/adts/string.c:1257)
   by 0x193ACF: c4m_resolve_path (../src/util/path.c:168)
   by 0x11B19A: c4m_con4m_root (../src/core/init.c:130)
   by 0x11B405: c4m_system_module_path (../src/core/init.c:155)
   by 0x11BDF5: c4m_init_path (../src/core/init.c:180)
   by 0x11BB08: c4m_init (../src/core/init.c:295)
   by 0x4F08DC3: call_init (libc-start.c:145)
   by 0x4F08DC3: __libc_start_main@@GLIBC_2.34 (libc-start.c:347)
   by 0x117724: (below main) (in /path/to/libcon4m/build_dev/c4test)
 Uninitialised value was created by a stack allocation
   at 0x194024: c4m_app_path (../src/util/path.c:458)


2 errors in context 6 of 9:
Conditional jump or move depends on uninitialised value(s)
   at 0x48A44DD: utf8proc_encode_char (utf8proc.c:180)
   by 0x1365ED: c4m_to_utf8 (../src/adts/string.c:569)
   by 0x1910AC: assemble_formatted_result (../src/util/format.c:524)
   by 0x1907BD: c4m_str_vformat (../src/util/format.c:575)
   by 0x1911AA: c4m_base_format (../src/util/format.c:591)
   by 0x1913DF: _c4m_cstr_format (../src/util/format.c:616)
   by 0x193889: internal_normalize_and_join (../src/util/path.c:109)
   by 0x193AD7: c4m_resolve_path (../src/util/path.c:167)
   by 0x11B19A: c4m_con4m_root (../src/core/init.c:130)
   by 0x11B405: c4m_system_module_path (../src/core/init.c:155)
   by 0x11BDF5: c4m_init_path (../src/core/init.c:180)
   by 0x11BB08: c4m_init (../src/core/init.c:295)
 Uninitialised value was created by a stack allocation
   at 0x194024: c4m_app_path (../src/util/path.c:458)


2 errors in context 7 of 9:
Conditional jump or move depends on uninitialised value(s)
   at 0x190FC2: assemble_formatted_result (../src/util/format.c:506)
   by 0x1907BD: c4m_str_vformat (../src/util/format.c:575)
   by 0x1911AA: c4m_base_format (../src/util/format.c:591)
   by 0x1913DF: _c4m_cstr_format (../src/util/format.c:616)
   by 0x193889: internal_normalize_and_join (../src/util/path.c:109)
   by 0x193AD7: c4m_resolve_path (../src/util/path.c:167)
   by 0x11B19A: c4m_con4m_root (../src/core/init.c:130)
   by 0x11B405: c4m_system_module_path (../src/core/init.c:155)
   by 0x11BDF5: c4m_init_path (../src/core/init.c:180)
   by 0x11BB08: c4m_init (../src/core/init.c:295)
   by 0x4F08DC3: call_init (libc-start.c:145)
   by 0x4F08DC3: __libc_start_main@@GLIBC_2.34 (libc-start.c:347)
   by 0x117724: (below main) (in /path/to/libcon4m/build_dev/c4test)
 Uninitialised value was created by a stack allocation
   at 0x194024: c4m_app_path (../src/util/path.c:458)


2 errors in context 8 of 9:
Conditional jump or move depends on uninitialised value(s)
   at 0x48A4334: UnknownInlinedFun (utf8proc.c:135)
   by 0x48A4334: utf8proc_iterate (utf8proc.c:125)
   by 0x135ECD: c4m_to_utf32 (../src/adts/string.c:605)
   by 0x190F72: assemble_formatted_result (../src/util/format.c:500)
   by 0x1907BD: c4m_str_vformat (../src/util/format.c:575)
   by 0x1911AA: c4m_base_format (../src/util/format.c:591)
   by 0x1913DF: _c4m_cstr_format (../src/util/format.c:616)
   by 0x193889: internal_normalize_and_join (../src/util/path.c:109)
   by 0x193AD7: c4m_resolve_path (../src/util/path.c:167)
   by 0x11B19A: c4m_con4m_root (../src/core/init.c:130)
   by 0x11B405: c4m_system_module_path (../src/core/init.c:155)
   by 0x11BDF5: c4m_init_path (../src/core/init.c:180)
   by 0x11BB08: c4m_init (../src/core/init.c:295)
 Uninitialised value was created by a stack allocation
   at 0x194024: c4m_app_path (../src/util/path.c:458)


2 errors in context 9 of 9:
Conditional jump or move depends on uninitialised value(s)
   at 0x484B9B8: strlen (vg_replace_strmem.c:505)
   by 0x13A2B5: utf8_init (../src/adts/string.c:644)
   by 0x133F1F: _c4m_new (../src/core/object.c:476)
   by 0x1940ED: c4m_app_path (../src/util/path.c:464)
   by 0x11B192: c4m_con4m_root (../src/core/init.c:130)
   by 0x11B405: c4m_system_module_path (../src/core/init.c:155)
   by 0x11BDF5: c4m_init_path (../src/core/init.c:180)
   by 0x11BB08: c4m_init (../src/core/init.c:295)
   by 0x4F08DC3: call_init (libc-start.c:145)
   by 0x4F08DC3: __libc_start_main@@GLIBC_2.34 (libc-start.c:347)
   by 0x117724: (below main) (in /path/to/libcon4m/build_dev/c4test)
 Uninitialised value was created by a stack allocation
   at 0x194024: c4m_app_path (../src/util/path.c:458)

ERROR SUMMARY: 15 errors from 9 contexts (suppressed: 0 from 0)

@viega
Copy link
Contributor Author

viega commented Jul 18, 2024

I don't get that crash; I'll look at it in a bit.

@viega
Copy link
Contributor Author

viega commented Jul 18, 2024

Okay, I see what the issue is; it was there before, and makes sense that it'd only trigger w/ ASAN / UBSAN. One sec.

@ee7
Copy link
Contributor

ee7 commented Jul 18, 2024

It seemed to be the other way around: the crash didn't happen when I enabled sanitizers. The steps in #88 (review) were without sanitizers.

Will check the new commit in a sec.

@viega
Copy link
Contributor Author

viega commented Jul 18, 2024

Either way would make sense, and I'm 100% sure it was the problem.

Copy link
Contributor

@ee7 ee7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Confirmed that 3fd9dec fixed what I was seeing.

Nit: Using a relative path like ./c4test ../tests/basic01.c4m seems to hang - is that supposed to be supported?

src/compiler/scope.c Outdated Show resolved Hide resolved
…nt was to be able to debug when a test does crash...
@viega viega merged commit ae7a185 into main Jul 18, 2024
3 checks passed
@viega viega deleted the jtv/dev branch July 18, 2024 13:44
@viega viega restored the jtv/dev branch July 18, 2024 23:10
@viega viega deleted the jtv/dev branch July 21, 2024 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants